//*** Rendering form AdditionWithAnimatedDice ***

oa.rf.additionWithAnimatedDice = new RenderingForm(
  "additionWithAnimatedDice",
  "Renders up to four dice that represent the summands of an addition problem.",
  RenderingModeEL.individually
);
/**
 * Tests if the AdditionWithAnimatedDice rendering form is applicable to  
 * a given arithmetic problem type
 * 
 * @author Gerd Wagner
 * @param {ArithmeticProblemType} ap Type of an arithmetic problem.
 * @return {Boolean} True if given type is applicable, else false.
 */
oa.rf.additionWithAnimatedDice.isApplicableTo = function (apt) {
  var isAddition = function (element, index, array) {
    return (element === OperatorEL.plus);
  };
  var hasDiceNumberRange = function (element, index, array) {
    return ((index==0) ? true : (element.lb === 1 && element.ub === 6));
  };
  return (
      apt instanceof ArithmeticProblemType && 
      apt.numberType === NumberTypeEL.NonNegativeInteger &&
      apt.askedFor === 0 &&
      apt.operators.length < 4 &&
      apt.operators.every( isAddition) &&
      apt.numberRanges.every( hasDiceNumberRange)
      );  
};
